-- card: 3773 from stack: in.6 -- bmap block id: 0 -- flags: 0000 -- background id: 3411 -- name: Type 3 XCMD -- part 1 (button) -- low flags: 80 -- high flags: A003 -- rect: left=229 top=149 right=171 bottom=478 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: "Change" Dialog with Radio Buttons ----- HyperTalk script ----- on mouseUp ShowDialog 3,4743,"Find What:","Change To:", "Your string goes here.",8 if the result is empty then put return & "You clicked the “Cancel” button." into bg fld "theResult" else put the result into temp if line 1 of temp = 7 then put "Button hilited was: Starts With" & return into bg fld "theResult" else if line 1 of temp = 8 then put "Button hilited was: Contains" & return into bg fld "theResult" else if line 1 of temp = 9 then put "Button hilited was: Whole Word" & return into bg fld "theResult" end if if line 2 of temp is empty then put "String 1 was: empty" & return after bg fld "theResult" else put "String 1 was:" && line 2 of temp & return after bg fld "theResult" if line 3 of temp is empty then put "String 2 was: empty" after bg fld "theResult" else put "String 2 was:" && line 3 of temp after bg fld "theResult" end if end mouseUp -- part 2 (button) -- low flags: 80 -- high flags: 0000 -- rect: left=11 top=4 right=64 bottom=78 -- title width / last selected line: 0 -- icon id / first selected line: 529 / 529 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: -- part 3 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=11 top=4 right=64 bottom=78 -- title width / last selected line: 0 -- icon id / first selected line: 529 / 529 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: SD -- part contents for background part 21 ----- text ----- ShowDialog XCMD Type 3 -- part contents for background part 30 ----- text ----- 15 -- part contents for background part 18 ----- text ----- ShowDialog XCMD Type 3 displays an "ask" dialog that can contain as many radio buttons and Editable Text fields as you desire. All the radio buttons must belong to a single "group." You pass in the parameter list which one of the radio buttons is to be initially hilited. The item # of the radio button that is hilited when the OK button is clicked is returned in "the result," along with the text of the editable text fields in a return-delimited list.            ••••••••••••••••• If you've been using versions of ShowDialog older than 1.6, please note that the result for Type 3 is now RETURN-delimited, instead of comma-delimited. ShowDialog Type 3 can also now have as many Editable Text fields as you desire.            ••••••••••••••••• -- part contents for background part 15 ----- text ----- ShowDialog Type 3 parameters are: ShowDialog 3,,,,,[,,] where 3 is the type of the external; is the resource ID of the DLOG template; consists of the dialog's first text string; consists of the dialog's second text string (if you want one); is a default text string to appear in a text entry field; is the DITL item # of the radio button that will be hilited when the dialog is initially displayed. Once again, the last two parameters, for specifying the location of the dialog, are OPTIONAL. -- part contents for background part 17 ----- text ----- Creating the resources for ShowDialog XCMD Type 3: The method for constructing DLOG/DITL templates for Type 3 of ShowDialog is similar as for Type 2. The only difference is that this type cannot contain a checkbox. Instead, put as many radio buttons as you want on the template. They will all be automatically grouped by ShowDialog XCMD into a single unit, making sure that only a single button can be hilited at a time. As you construct your template, make note of the item # of the radio button that you would like to be hilited when the dialog is initially displayed. You will pass this item number in the parameter list. The result consists of a return-delimited list. Line 1 of the result will contain the item # of the radio button that was hilited when OK was clicked. The remaining lines of the result will contain the contents of your Editable Text fields. If the user clicks the Cancel button "the result" will be empty.